//
//  PKPlayListTableViewCell.m
//  PianKe
//
//  Created by lanou on 15/12/25.
//  Copyright © 2015年 KFC. All rights reserved.
//

#import "PKPlayListTableViewCell.h"

@implementation PKPlayListTableViewCell



-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self addSubViews];
    }
    return self;
}

- (void)addSubViews
{
    _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 250, 20)];
   // _titleLabel.backgroundColor = [UIColor yellowColor];
    _titleLabel.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:_titleLabel];
    
    _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(_titleLabel.left - 2, _titleLabel.bottom + 5, _titleLabel.width / 2, _titleLabel.height / 2 + 10)];
  //  _nameLabel.backgroundColor = [UIColor greenColor];
    _nameLabel.font = [UIFont systemFontOfSize:11];
    _nameLabel.textColor = [UIColor grayColor];
    [self.contentView addSubview:_nameLabel];
    
    
    _downLoadButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    _downLoadButton.frame = CGRectMake(kScreenWidth - 80 - 10, _titleLabel.top, 80, 20);
    _downLoadButton.backgroundColor = [UIColor tiankonglan];
   // [_downLoadButton setBackgroundImage:[UIImage imageNamed:@"xiazai2"] forState:(UIControlStateNormal)];
    [_downLoadButton setTitle:@"下载" forState:(UIControlStateNormal)];
    _downLoadButton.titleLabel.font = [UIFont systemFontOfSize:10];
    [self.contentView addSubview:_downLoadButton];
    
    
    _isSelectLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 5, 55)];
    _isSelectLabel.backgroundColor = [UIColor tanguolu];
    _isSelectLabel.alpha = 0;
    [self.contentView addSubview:_isSelectLabel];
    
}

// 重写setModel方法
-(void)setModel:(PKDetailModel *)model
{
    _model = model;
    
    // 赋值
    self.titleLabel.text = model.title;
    self.nameLabel.text = model.uname;
    _model.isDown = NO;
 
}





- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
